/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

export async function validateForm(form) {
  const f = (resolver, reject) => {
    form.validate((valid) => {
      resolver(valid)
    })
  }
  return new Promise(f)
}
